package com.wink_172

import android.content.Intent
import com.example.bibuproject.service.AppoperationServiceConnect
import com.example.bibuproject.service.BackgroundService
import com.wink_172.library.LibApplication
import com.wink_172.library.utils.CommonUtils
import com.wink_172.model.Constants
import org.xutils.x

class ABpplication : LibApplication() {

    companion object instance {
        var connect: AppoperationServiceConnect? = null
    }

    override fun onCreate() {
        super.onCreate()

//      CommonUtils.preinitUMeng(this,Constants.UMENG_KEY);
        CommonUtils.initUMeng(this, Constants.UMENG_KEY)

        x.task().postDelayed(kotlinx.coroutines.Runnable {
            CommonUtils.testUMEvent()
        },2000)

        startService()

//        TencentCosUtils.initTectentCos("","","")
    }

    fun startService() {
        var appServiceIntent = Intent(x.app(), BackgroundService::class.java)
        connect = AppoperationServiceConnect()
        bindService(appServiceIntent, connect!!, BIND_AUTO_CREATE)
    }
}